<?php

namespace app\common\model\mysql;

use think\Model;

class SGoodsGroupPlay extends Model
{
    /**
     * 自动生成写入时间
     * @var bool
     */
    protected $autoWriteTimestamp = true;

    public function getGoodsGroupPlayByIdFind($id,$field = '*'){
        if(empty($id)){
            return false;
        }
        $where = [
            "goods_group_play_id" =>$id,
        ];
        $result = $this->where($where)->field($field)->find();
        return $result->toArray();
    }

    public function updateById($id,$data){
        $id = intval($id);
        if(empty($id) || empty($data) || !is_array($data)){
            return false;
        }
        $where = [
            "goods_group_play_id"=>$id,
        ];
        return $this->where($where)->save($data);
    }
}
